package com.css.config.thread;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.css.config.FrescoProperties;

import lombok.Data;

/**
 * 线程池配置属性类
 * @author https://juejin.im/entry/5abb8f6951882555677e9da2
 */
@Data
@Component
public class AsyncTaskProperties {

    public int corePoolSize;

    public int maxPoolSize;

    public int keepAliveSeconds;

    public int queueCapacity;
    
    @Autowired
    private FrescoProperties frescoProperties;

    public int getCorePoolSize() {
        return frescoProperties.getTask().getCorePoolSize();
    }

    public int getMaxPoolSize(int maxPoolSize) {
    	return frescoProperties.getTask().getMaxPoolSize();
    }

    public int getKeepAliveSeconds(int keepAliveSeconds) {
    	return frescoProperties.getTask().getKeepAliveSeconds();
    }

    public int getQueueCapacity(int queueCapacity) {
    	return frescoProperties.getTask().getQueueCapacity();
    }
}
